<template>
  <div class="big-customer">
    姓名：<el-input v-model="input" placeholder="请输入内容"></el-input>
    姓名：<el-input v-model="input" placeholder="请输入内容"></el-input>
    姓名：<el-input v-model="input" placeholder="请输入内容"></el-input>
    姓名：<el-input v-model="input" placeholder="请输入内容"></el-input>
    姓名：<el-input v-model="input" placeholder="请输入内容"></el-input>
    姓名：<el-input v-model="input" placeholder="请输入内容"></el-input>
    姓名：<el-input v-model="input" placeholder="请输入内容"></el-input>
    <el-table :data="tableData" style="width: 100%" border>
      <el-table-column type="index" label="ID"> </el-table-column>
      <el-table-column prop="Sales_name" label="联系人"> </el-table-column>
      <el-table-column prop="phone" label="手机号"> </el-table-column>
      <el-table-column :formatter="dateFormat" label="开通时间">
      </el-table-column>
      <el-table-column prop="contactsName" label="代理人"> </el-table-column>
      <el-table-column prop="sales_calls" label="联系电话"> </el-table-column>
      <el-table-column prop="province" label="省"> </el-table-column>
      <el-table-column prop="city" label="市"> </el-table-column>
      <el-table-column prop="area" label="区"></el-table-column>
      <el-table-column prop="Account_status" label="账号状态">
        <template slot-scope="scope">
          <el-switch
            v-model="scope.row.Account_status"
            active-color="#13ce66"
            inactive-color="#ff4949"
          >
          </el-switch>
          {{ scope.row.Account_status }}
        </template>
      </el-table-column>
      <el-table-column label="操作">
        <template slot-scope="scope">
          <el-button type="text" size="small" @click="scope;"> 详情 </el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>
<script>
import vue from "vue";
import moment from "moment";
import { Button, Table, TableColumn, Switch } from "element-ui";
vue.use(Button);
vue.use(Table);
vue.use(TableColumn);
vue.use(Switch);
import { getAllKeyAccounts } from "../../network/3-customer/bigCustomerList";
export default {
  data() {
    return {
      tableData: [],
      input:''
    };
  },
  created() {
    getAllKeyAccounts().then((res) => {
      this.tableData = res.data.data;
      console.log(this.tableData);
    });
  },
  methods: {
    dateFormat(row) {
      let date = row.timer;
      return moment(date).format("YYYY-MM-DD HH:mm:ss");
    },
  },
};
</script>
<style scoped>
.el-table {
  line-height: 100%;
}
.el-input{
  width: 200px;
}
</style>